
function dohome(){
	this.home.style.behavior='url(#default#homepage)';this.home.setHomePage('http://www.szepb.gov.cn');
}


function selectobj(obj,CityN,LayerID){
	document.getElementById(obj).value=CityN;
	document.getElementById(obj).className='InputStyle';
	if(LayerID!="")
	   document.getElementById(LayerID).style.display='none';
}

function DPBlock(a){
	document.getElementById(a).style.display='block';
}

function DPNone(a){
	document.getElementById(a).style.display='none';
}
 





 function setTab(strNewsTitle,strNewsContent,strTag)
 {
	var Tags=document.getElementById(strNewsTitle).getElementsByTagName(strTag); 
	var TagsCnt=document.getElementById(strNewsContent).getElementsByTagName('span'); 
	var len=Tags.length; 
	var flag=0;
	for(i=0;i<len;i++){
		Tags[i].value = i;
		Tags[i].onmouseover=function(){changeNav(this.value)}; 
		TagsCnt[i].className='undis';					
	}
		Tags[flag].className='topC1';
		TagsCnt[flag].className='dis';
	function changeNav(v){	
		Tags[flag].className='topC0';
		TagsCnt[flag].className='undis';
		flag=v;	
		Tags[v].className='topC1';
		TagsCnt[v].className='dis';
	}
}



 function setTabClick(strNewsTitle,strNewsContent,strTag)
 {
	var Tags=document.getElementById(strNewsTitle).getElementsByTagName(strTag); 
	var TagsCnt=document.getElementById(strNewsContent).getElementsByTagName('span'); 
	var len=Tags.length; 
	var flag=0;
	for(i=0;i<len;i++){
		Tags[i].value = i;
		Tags[i].onclick=function(){changeNav(this.value)}; 
		TagsCnt[i].className='undis';					
	}
		Tags[flag].className='topC1';
		TagsCnt[flag].className='dis';
	function changeNav(v){	
		Tags[flag].className='topC0';
		TagsCnt[flag].className='undis';
		flag=v;	
		Tags[v].className='topC1';
		TagsCnt[v].className='dis';
	}
}


 function setTabClick2(strNewsTitle,strNewsContent,strTag)
 {
	var Tags=document.getElementById(strNewsTitle).getElementsByTagName(strTag); 
	var TagsCnt=document.getElementById(strNewsContent).getElementsByTagName('dd'); 
	var len=Tags.length; 
	var flag=0;
	for(i=0;i<len;i++){
		Tags[i].value = i;
		Tags[i].onclick=function(){changeNav(this.value)}; 
		TagsCnt[i].className='undis';					
	}
		Tags[flag].className='topC1';
		TagsCnt[flag].className='dis';
	function changeNav(v){	
		Tags[flag].className='topC0';
		TagsCnt[flag].className='undis';
		flag=v;	
		Tags[v].className='topC1';
		TagsCnt[v].className='dis';
	}
}



function setFont(x)
{
  switch (x){
    case 1:
		document.getElementById("endtext").className="endbig";		
		document.getElementById("e_b").className="sel";
		document.getElementById("e_n").className="unsel";
		document.getElementById("e_s").className="unsel";
	break;
	case 2:
		document.getElementById("endtext").className="endnomal";
		document.getElementById("e_n").className="sel";
		document.getElementById("e_b").className="unsel";
		document.getElementById("e_s").className="unsel";
	break;
	case 3:
		document.getElementById("endtext").className="endsmall";
		document.getElementById("e_s").className="sel";
		document.getElementById("e_n").className="unsel";
		document.getElementById("e_b").className="unsel";
      break;
	}
} 




var DDSPEED = 10;
var DDTIMER = 15;
var OFFSET = -2;
var ZINT = 100;

function ddMenu(id,d){
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
  clearInterval(c.timer);
  if(d == 1){
    clearTimeout(h.timer);
    c.style.display = 'block';
    if(c.maxh && c.maxh <= c.offsetHeight){return}
    else if(!c.maxh){
      c.style.left = (h.offsetWidth + OFFSET) + 'px';
      c.style.height = 'auto';
      c.maxh = c.offsetHeight;
      c.style.height = '0px';
    }
    ZINT = ZINT + 1;
    c.style.zIndex = ZINT;
    c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
  }else{
    h.timer = setTimeout(function(){ddCollapse(c)},50);
  }
}

function ddCollapse(c){
  c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
}

function cancelHide(id){
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
  clearTimeout(h.timer);
  clearInterval(c.timer);
  if(c.offsetHeight < c.maxh){
    c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
  }
}

function ddSlide(c,d){
  var currh = c.offsetHeight;
  var dist;
  if(d == 1){
    dist = Math.round((c.maxh - currh) / DDSPEED);
  }else{
    dist = Math.round(currh / DDSPEED);
  }
  if(dist <= 1 && d == 1){
    dist = 1;
  }
  c.style.height = currh + (dist * d) + 'px';
  c.style.opacity = currh / c.maxh;
  c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
  if(currh > (c.maxh - 2) && d == 1){
    clearInterval(c.timer);
  }else if(dist < 1 && d != 1){
    clearInterval(c.timer);
    c.style.display = 'none';
  }
}




function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/**
 * 全文搜索调用的函数
 */
function toSer(){
	var keyvalue = document.getElementById("keyword").value; 	
	keyvalue = keyvalue.replace(/\s+/g,"");
	
	if( keyvalue == '请输入关键字' || '' == keyvalue){
		alert('请输入关键字!');
		return false;
	}else{
		  document.getElementById("keyword").value = encodeURI(keyvalue);
		  document.getElementById("opForm").submit(); 
		  document.getElementById("keyword").value = keyvalue;
		  return false;
	}
}



//$(
//	function(){
//		$.ajax(
//			{
//				type:'GET',
//				url:'/kshbmh/pages/ebcm/business/jsxmsp/spxxWeb/spxxAjaxWeb.jsp',
//				dataType:'json',
//				async:'false',
//				data:'',
//				success:function(data){
//					var htmlStr = '';
//					var title = '';
//					$.each(data,function(i,n){
//						if(i != 'SPXX_9'){
//							if(n.SP_TITLE.length > 24){
//								title = n.SP_TITLE.substr(0,24) + '...';
//							}else{
//								title = n.SP_TITLE;
//							}
//							htmlStr += '<li><a href="/hppf2?xmbh=' + n.XMBH + '">'+ title + '</a></li>'
//						}
//					});
//					$('#spxx_id').prepend(htmlStr);
//				},
//				error:function(){
//					alert('error data');
//				}
//			}
//		);
//	}
//);

//把时间类型的数字转换为各种需要的字符串

function MM_dateFormat() {
    //格式化日期显示   
    //fenge   =   0     ：2006-02-28   12:34:23   
    //fenge   =   1     ：2006-02-28   
    //fenge   =   2     ：2006年2月28日     
    //fenge   =   3     ：2月28日   
    //fenge   =   4     ：28/2   
    //fenge   =   5     ：二○○六年二月二十八日   
    //fenge   =   6     ：12:34:23   
    //fenge   =   7     ：20060228
    var fenge = 0;
     var tmpDate = new Date()
    var result = "";
    switch (fenge) {
        case 1:
            result += tmpDate.getFullYear() + "-";
            if ((tmpDate.getMonth() + 1) < 10) result += "0" + (tmpDate.getMonth() + 1) + "-"; else result += (tmpDate.getMonth() + 1) + "-";
            if (tmpDate.getDate() < 10) result += "0" + tmpDate.getDate(); else result += tmpDate.getDate();
            break;
        case 2:
            result = tmpDate.getFullYear() + "年" + (tmpDate.getMonth() + 1) + "月" + tmpDate.getDate() + "日";
            break;
        case 3:
            result = (tmpDate.getMonth() + 1) + "月" + tmpDate.getDate() + "日";
            break;
        case 4:
            result = tmpDate.getDate() + "/" + (tmpDate.getMonth() + 1);
            break;
        case 5:
            var zhifu = "○一二三四五六七八九十";
            var zhrq = "";
            var nan = String(tmpDate.getFullYear());
            for (iii = 0; iii < nan.length; iii++) { zhrq += zhifu.substr(nan.substr(iii, 1), 1); }
            zhrq += "年";
            var nan = String(tmpDate.getMonth() + 1);
            if (nan.length == 2) {
                if (nan.substr(0, 1) == "1") zhrq += "十"; else zhrq += zhifu.substr(nan.substr(0, 1), 1) + "十";
                if (nan.substr(1, 1) == "0") zhrq += "月"; else zhrq += zhifu.substr(nan.substr(1, 1), 1) + "月"
            } else {
                zhrq += zhifu.substr(nan.substr(0, 1), 1) + "月";
            }
            var nan = String(tmpDate.getDate());
            if (nan.length == 2) {
                if (nan.substr(0, 1) == "1") zhrq += "十"; else zhrq += zhifu.substr(nan.substr(0, 1), 1) + "十";
                if (nan.substr(1, 1) == "0") zhrq += "日"; else zhrq += zhifu.substr(nan.substr(1, 1), 1) + "日"
            } else {
                zhrq += zhifu.substr(nan.substr(0, 1), 1) + "日";
            }
            result = zhrq;
            break;
        case 6:
            if (tmpDate.getHours() < 10) result += "0" + tmpDate.getHours(); else result += "" + tmpDate.getHours();
            if (tmpDate.getMinutes() < 10) result += ":0" + tmpDate.getMinutes(); else result += ":" + tmpDate.getMinutes();
            if (tmpDate.getSeconds() < 10) result += ":0" + tmpDate.getSeconds(); else result += ":" + tmpDate.getSeconds();
            break;
        case 7:
            result += tmpDate.getFullYear();
            if ((tmpDate.getMonth() + 1) < 10) result += "0" + (tmpDate.getMonth() + 1); else result += (tmpDate.getMonth() + 1);
            if (tmpDate.getDate() < 10) result += "0" + tmpDate.getDate(); else result += tmpDate.getDate();
            break;
        default:
            result += tmpDate.getFullYear() + "-";
            if ((tmpDate.getMonth() + 1) < 10) result += "0" + (tmpDate.getMonth() + 1) + "-"; else result += (tmpDate.getMonth() + 1) + "-";
            if (tmpDate.getDate() < 10) result += "0" + tmpDate.getDate(); else result += tmpDate.getDate();
            if (tmpDate.getHours() < 10) result += "   0" + tmpDate.getHours(); else result += "   " + tmpDate.getHours();
            if (tmpDate.getMinutes() < 10) result += ":0" + tmpDate.getMinutes(); else result += ":" + tmpDate.getMinutes();
            if (tmpDate.getSeconds() < 10) result += ":0" + tmpDate.getSeconds(); else result += ":" + tmpDate.getSeconds();
            break;
    }
    return result
}  